
package packhib;

import packhib.HibernateSessionFactory;
import packhib.Utilisateur;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.Transaction;

public class ServiceCompetance {
	
	
	public void add(Competance comepetance)
				{
					Session session = HibernateSessionFactory.getSession();
					Transaction tr = session.beginTransaction();
					session.save(comepetance);
					tr.commit();
				}
				
				public List listCompetance()
				{
					Session session = HibernateSessionFactory.getSession();
					session.clear();
					Transaction tr = session.beginTransaction();
					Criteria cri = session.createCriteria(Competance.class);
					List res = cri.list();
					tr.commit();
					
					return res;
				}

			
			
			

		




	

}
